Label component uniform buffers with their component type name - #3
Closed
stuartparmenter wants to merge 4 commits into
Closed
Label component uniform buffers with their component type name#3stuartparmenter wants to merge 4 commits into
stuartparmenter wants to merge 4 commits into
Conversation
stuartparmenter
force-pushed
the
hdr-wave1-render-infra
branch
from
August 10, 2026 20:45
fb0cb13 to
bb3ed3f
Compare
stuartparmenter
force-pushed
the
hdr-wave1-render-infra
branch
from
August 10, 2026 20:48
bb3ed3f to
f11f1d8
Compare
stuartparmenter
marked this pull request as ready for review
August 10, 2026 22:05
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Objective
ComponentUniforms<C>creates its buffer without a label. wgpu-core identifies resources in validation errors asBuffer with '<label>' label, so these come out asBuffer with '' labeland there is no way to tell which uniform buffer went wrong.The
type_label_buffersfeature fills in a type name at the buffer creation site, but it is off in a default build.Solution
C's type name inDefault for ComponentUniforms<C>.set_labelandget_labelfromimpl<T: ShaderType + WriteInto> DynamicUniformBuffer<T>to aShaderType-only block. Neither usesT, so theWriteIntobound was incidental. This keepsDefault for ComponentUniforms<C>atC: Component + ShaderType, so nothing breaks and no migration guide is needed.bevyengine#22698 moved label prepopulation out of constructors because
type_name()returns a&'static strwhilelabelis anOption<String>, and.to_string()is not const. That only blocks const constructors; this one is not const.Testing
cargo check -p bevy, with and withoutbevy_render/debug.cargo fmt --check.This PR was built by me with the assistance of Claude Code w/ Fable 5